<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Upload new File</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background: #f7f7f7;
        }
        .container {
            max-width: 600px;
            margin: auto;
            background: #fff;
            padding: 20px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        h1 {
            font-size: 24px;
        }
        form {
            margin-bottom: 20px;
        }
        ul {
            list-style: none;
            padding: 0;
        }
        li {
            margin-bottom: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        li a {
            flex: 1;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            margin-right: 10px;
        }
        li form {
            margin: 0;
        }
        input[type=file] {
            border: 1px solid #ddd;
            padding: 5px;
            width: calc(100% - 70px);
        }
        input[type=submit] {
            background: #5cb85c;
            border: none;
            padding: 5px 10px;
            color: #fff;
            cursor: pointer;
        }
        input[type=submit]:hover {
            background: #4cae4c;
        }
        @media (max-width: 767px) {
            h1 {
                font-size: 20px;
            }
            .container {
                padding: 15px;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>Upload new File</h1>
        <form action="/upload" method="post" enctype="multipart/form-data">
            <input type="file" name="file">
            <input type="submit" value="Upload">
        </form>
        <h1>Files</h1>
        <ul>
            {% for file, size in files %}
            <li>
                <a href="{{ url_for('uploaded_file', filename=file) }}">{{ file }} | {{size}}</a>
                <form action="{{ url_for('delete_file', filename=file) }}" method="post">
                    <input type="submit" value="Delete">
                </form>
            </li>
            {% endfor %}
        </ul>
    </div>
</body>
</html>
